home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / Borland Plateform / Turbo Prolog 2 / EXAMPL54.PRO < prev    next >
Encoding:
Prolog Source  |  1986-04-25  |  467 b   |  19 lines

  1.                     /* Program 54 */
  2. domains
  3.     d = integer
  4. predicates
  5.     not_(D,D)
  6.     and_(D,D,D)
  7.     or_(D,D,D)
  8.     xor(D,D,D)
  9. clauses
  10.     not_(1,0).   not_(0,1).
  11.     and_(0,0,0). and_(0,1,0). and_(1,0,0).  and_(1,1,1).
  12.     or_(0,0,0).  or_(0,1,1).  or_(1,0,1).   or_(1,1,1).
  13.  
  14.     xor(Input1,Input2,Output) if
  15.          not_(Input1,N1) and not_(Input2,N2) and
  16.          and_(Input1,N2,N3) and and_(Input2,N1,N4) and
  17.          or_(N3,N4,Output).
  18.  
  19.